package nl.utwente.fmt.vertalerbouw.tarrh.checker;

/**
 * Class to hold all data related to class entries in the checker.
 */
public class CheckerClassEntry {
	private CheckerClassEntry arrayClass = null;
	private CheckerClassEntry elementClass = null;

	/**
	 * Get the array type of the class represented by this entry.
	 * 
	 * @return the array type of this class.
	 */
	public CheckerClassEntry getArrayTypeOfThisClass() {
		if (arrayClass == null) {
			arrayClass = new CheckerClassEntry();
			arrayClass.elementClass = this;
		}
		return arrayClass;
	}

	/**
	 * Get the element type if this entry represents an array.
	 * 
	 * @return the element type if this entry represents an array, null
	 *         otherwise.
	 */
	public CheckerClassEntry getElementType() {
		return elementClass;
	}

	/**
	 * Returns true if this entry represents an array.
	 * 
	 * @return true if this entry represents an array, false otherwise.
	 */
	public boolean isArrayType() {
		return elementClass != null;
	}
}
